﻿using System;

namespace Aeon.Framework.Objects
{

/// <summary>
/// Abstract stub for OpenGL entities.
/// Provides IKey, IDraw, IMove, ITurn and IMaterial.
/// Only requires Draw implementation.
/// 
/// </summary>
public abstract class ObjectBase : IKey, IMove, ITurn, IDraw, IMaterial
    {
    // --- Inteface Fields:

    protected String id;          
    protected Position origin;  
    protected Orientation angle; 
    protected AeonMaterial material;

    // --- Interface Acessors:

    public String ID { get { return(id); }  }
    public Position Origin { get { return(origin); } }
    public Orientation Angle { get { return(angle); } }
    public AeonMaterial Material { get { return(material); } }

    // --- Constructor:

    public ObjectBase(String key, Position origin, Orientation angle, AeonMaterial material)
        {
        id = key;
        this.angle = angle;
        this.origin = origin;
        this.material = material;
        }

    // --- Interface Methods:

    public void MoveTo(Position pos) { origin.Change(pos); }
    public void MoveBy(IVector vec) { origin.Transform(vec); }

    public void RotateTo(Orientation ang) { angle.Change(ang); }
    public void RotateBy(Orientation ang) { angle.Transform(ang); }

    // --- Abstract:

    public abstract void Draw();
    }


}
